<%@ page import="java.util.ArrayList" %> <%@ page import="ysl.util.Log" %> <%@ page import="ysl.util.Log,ysl.util.Utils, ysl.util.Term, ysl.ui.session.YslSession" %> <%@ page import="ysl.util.YslMachineProperties, ysl.buslog.orgs.OrgEntity" %> <%@ page import="ysl.buslog.orgs.Club, ysl.buslog.users.Role" %> <%@ page import="ysl.buslog.users.User, ysl.buslog.users.UserRole, ysl.buslog.users.Action" %> <%@ include file="TestSessionFragment.jsp" %> <% // Log.logLow("specialGuest='" + YslSession.getSpecialGuest(session) + "'"); String testStr = Utils.getProperty("javaMail.from"); if (testStr == null) // database has crashed { Utils.notifyAdmin("Database is apparently down - 'null' returned for javaMail.from\n", request); out.println("" + ServletUtils.getSiteTitle(request) + " Technical Difficulty!"); out.println("
"); out.println(ServletUtils.getSiteTitle(request) + " is experiencing technical difficulties
"); out.println("The technical folks have been notified
"); out.println("No need to adjust your set...
"); out.println("Please close your browser and try again in a few minutes"); out.println("
"); } else if (currentUserRole.getRoleId() == Role.GUEST_ID && YslSession.getSpecialGuest(session) != null) { ServletUtils.sendRedirect("/" + YslSession.getSpecialGuest(session) + ".jsp?YSLkey=" + YSLkey + YslSession.getIdParm(session), request, response); return; } else { String URL = request.getRequestURL().toString().toLowerCase(); String siteTitle = Term.getSiteTitle(URL); // String imageDir = YslMachineProperties.getTomcatImagesDirectory(); // KLUDGE - force session attribute - SCW 1/31/2007 - bug 1114 YslSession.setEditUserReturnJsp(session, null); YslSession.setEditTeamServletNextJsp(session, "UserHome.jsp"); // KLUDGE - force session attribute - SCW 2/6/2007 - bug 1043 session.setAttribute("TourElimServlet", null); String pageTitle = currentUser.getDisplayName() + " Home Page at " + siteTitle; %> <%@ include file="headerHome.jsp" %>
 
<% if (userRole != null && userRole.getRoleId() != Role.GUEST_ID) { %> <% } %>
<% out.print(currentUser.getDisplayName()); out.println("
-- Home Page --"); %>

<%@ include file="ShowStatusMessageFragment.jsp" %> <% ArrayList userRoles = new ArrayList(currentUser.getUserRoles()); for (int rolesNdx = 0; rolesNdx < userRoles.size(); rolesNdx++) { userRole = (UserRole)userRoles.get(rolesNdx); League league = userRole.getEntity() == null ? null : userRole.getEntity().getLeague(); if (userRole.isActive() && userRole.getRoleId() != Role.YSL_USER_ID && userRole.getRoleId() != Role.GHOST_ID) { String helpFile = userRole.getRole().getHelpFile(); if (helpFile == null) helpFile = "IntroRoles"; String roleKey = ServletUtils.makeKey(userRole.getId()); out.println(""); out.println(""); out.println("
  "); out.println(userRole.toLinkedString()); out.println("  "); if (league != null && Utils.hasData(helpFile)) { %>       <% } out.println("
"); actions = userRole.getSortedActions(); if (actions.size() > 0) { for (actionNdx = 0; actionNdx < actions.size(); actionNdx++) { action = (Action)actions.get(actionNdx); String invalidString = action.checkValidity(userRole); String actionName = action.getName(); String actionDesc = action.getDesc(); int sportType = 0; int leagueId = 0; if (league != null) { sportType = league.getSportType(); leagueId = league.getId(); } if (Utils.hasData(invalidString)) invalidString = Term.termFilter(invalidString, sportType, leagueId); if (invalidString == null) { %> <% if (actionDesc != null) { %> <% } %> <% } else { %> <% } } } else out.println("-- No actions specified for this role, yet. More features coming soon! --"); out.println("
* <%= actionName %> -- <%= actionDesc %>
* <%= actionName %> -- <%= invalidString %>
"); out.println("

"); } } %>

<% } %>